package com.qin.mall.controller.ordercontroller;

import com.qin.mall.common.api.CommonResult;
import com.qin.mall.domain.OmsOrderSetting;
import com.qin.mall.openfeign.order.OmsOrderSettingFeigin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Leisure
 * create 2022 2022/11/22 11:01
 **/
@RestController
@RequestMapping("/orderSetting")
public class OrderSettingController {
    
    @Autowired
    private OmsOrderSettingFeigin orderSettingFeigin;

    /**
     * 获取指定订单设置
     */
    @GetMapping("/{id}")
    public CommonResult<OmsOrderSetting> orderSetting(@PathVariable Long id){
        CommonResult<OmsOrderSetting> setting = orderSettingFeigin.orderSetting(id);
        return setting;
    }


    /**
     * 修改指定订单设置
     */
    @PostMapping("/update/{id}")
    public CommonResult update(@PathVariable Long id,
                               @RequestBody OmsOrderSetting orderSetting){
        CommonResult update = orderSettingFeigin.update(id, orderSetting);
        return update;
    }


}
